﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ResourceManage.aspx.cs" Inherits="ZX.WebApp.Crm.MeetingArrange.ResourceManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>谈单老师总结</title>
<style type="text/css">
    .readOnly
    {
        background-color:lightgrey ;
    }
</style>
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />

    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.form.js" type="text/javascript"></script>
    <script src="../../Scripts/CombinButton.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../../Scripts/yui_2.9.0/build/paginator/paginator-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../../scripts/yui_2.9.0/build/event-delegate/event-delegate-min.js"></script>

</head>
<body  class="yui-skin-sam">
    <form id="form1" runat="server">
    <div>
       <div id="toolbar" >
            <button type="button" id="btnSave" name="btnSave">
                保存</button>
            <button type="button" id="btnClose" name="btnClose">
                返回</button>
     </div>
    <div>
        <table id="TeacherSum">
            <tr><td>客户编码:</td><td><input type="text" name="Code" /></td><td>客户名称:</td><td><input type="text" name="CustomerName" class="readOnly" readonly="readonly"/></td><td>客户来源:</td><td><input type="text" name="originName"  class="readOnly" readonly="readonly"/></td></tr>
            <tr><td>信息专员:</td><td><input type="text" name="AddUserName" class="readOnly" readonly="readonly"/></td><td>行销顾问:</td><td><input type="text" name="SaleadviserName" class="readOnly"  readonly="readonly"/></td><td>一推讲师:</td><td><input type="text" name="LectorName" class="readOnly" readonly="readonly"/></td></tr>
            <tr><td>客户经理:</td><td><input type="text" name="CustomerMgrName" class="readOnly" readonly="readonly"/></td><td>课中服务人:</td><td><input type="text" name="ClassServerName" readonly="readonly" class="readOnly"/></td><td colspan='2'></td></tr>
            <tr><td>对客户的承诺:</td><td colspan='5'><textarea  style='width:100%' cols='5' rows="5" id="CustomerPromis" name='CustomerPromis'> </textarea></td></tr>
            <tr><td>特别馈赠:</td><td colspan='5'><textarea style='width:100%' cols='5' rows="5" id="PresentProduct" name='PresentProduct'> </textarea></td></tr>
            <tr><td>备注:</td><td colspan='5'><textarea style='width:100%' rows="5" id="Explain" name='Explain'> </textarea></td></tr>
        </table>
    </div>
    </div>
    </form>
     <form id="form2" action="AjaxData/DataSave.aspx">
     <textarea style="display: none" id="jsonDataContent" rows="2" cols="2" name="jsonDataContent"></textarea>
    </form>
</body>
<script type="text/javascript">
     <asp:Literal ID="EditTemplate" runat="server"></asp:Literal>
     <asp:Literal ID="EditTemplate1" runat="server"></asp:Literal>
     //布局初始化
    (function () {
        var Dom = YAHOO.util.Dom,
            Event = YAHOO.util.Event;
        Event.onDOMReady(function () {
            var layout = new YAHOO.widget.Layout({
                units: [
                { position: 'top', height: 35, body: 'toolbar', gutter: '1 1 1 1', scroll: null, zIndex: 2 },
                { position: 'center', body: 'TeacherSum', gutter: '0 1 1 1', scroll: true }
                ]
            });
            layout.render();
        });
       })();
       //注册按钮事件
       YAHOO.namespace("example.container");
      YAHOO.example.init = function () {
        function onButtonClick(p_oEvent) {
            switch (this.get("id")) {
                case "btnSave":
                    Save();
                    break;
                case "btnClose":
                    Close();
                    break;
                default:
                    break;
            }
        }
        YAHOO.util.Event.onContentReady("toolbar", function () {
           var btnSave = new YAHOO.widget.Button("btnSave");
            btnSave.on("click", onButtonClick);
           var btnClose = new YAHOO.widget.Button("btnClose");
            btnClose.on("click", onButtonClick);
    });
    } ();
    //初始化表格内容
    $("#TeacherSum").JSONToForm($.toJSON(instance[0]));
    $("#TeacherSum").JSONToForm($.toJSON(instanceManagerSum[0]));
    //将对象赋值
    var setValue=function(){
      <asp:Literal ID="jSave" runat="server"></asp:Literal>
       if('<%=isEdit %>'!='True')
         {
            instanceManagerSum[0].ID='<%=Guid.NewGuid()%>';
         }
         instanceManagerSum[0].DeliverMajorID=getPar1("id");
    }
    //保存
    var Save=function(){
       setValue();
       var url = "../../Extend/AjaxData/DataSave.aspx";
       var json =$.toJSON(instanceManagerSum[0]).replace(/'/g,"[B]");
        $("#jsonDataContent").val(json);
        var formObject = document.getElementById('form2');
         YAHOO.util.Connect.setForm(formObject);
         var action="",entity="CrmManagerSum";
         if('<%=isEdit %>'=='True')
         {
            action="update";
         }
         else
         {
            action="insert";
         }
        var cObj = YAHOO.util.Connect.asyncRequest('POST',url+"?flag=1&action="+action+"&entity="+entity,callback);
         alert('操作成功');
        Close();
    }
    //关闭当前页
    var Close = function () {
        window.parent.$("#tabs").tabs('close', '谈单老师总结');
    }

</script>
</html>
